home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.cyberramp.net!news
- From: sinan@cyberramp.net (John Noland)
- Newsgroups: comp.lang.c
- Subject: Re: problem passing a string
- Date: 13 Mar 1996 00:15:53 GMT
- Organization: Prose Software
- Message-ID: <4i543p$83r@newshost.cyberramp.net>
- References: <4hrtsp$4mf@mulgave.octacon.co.uk>
- NNTP-Posting-Host: ramp3-25.cyberramp.net
- X-Newsreader: WinVN 0.99.5
-
- In article <4hrtsp$4mf@mulgave.octacon.co.uk>, Nik.Palmer@onyx.octacon.co.uk says...
- >
- >Hi, Im using a textoutput routine in the fastgraph package of the
- >form below
- > void fg_print(char *string,int n);
- >The string that I want to pass is initialised as below
- >
- >char string[6]
- ^^^^^^^^^
- Should be: char string1[6];
-
- >double variable= 1.2345
- >sprintf(string1,"%5f",variable)
- ^^^
- Look up the conversion specifiers again. You're not using this properly.
- Hint: How far to the right of the decimal do you want to go?
- >
- >fg_print(string1,5)
- >
-
- -John
-
-